from microbit import *


class ASR(object):
    def get_ASR(self):
        try:
            t = i2c.read(0x0B, 1)
            return t[0]
        except:
            pass

    def w(self, v):
        i2c.write(0x0B, bytearray(v))

    def learn(self):
        self.w([0x50])

    def clear(self):
        self.w([0x60])


asr = ASR()
